﻿using System;
using System.Collections.Generic;
using System.Text;

namespace XDesigner.ORM.Test
{
    [Serializable()]
    [ORMType("Products")]
    [System.ComponentModel.TypeConverter(typeof(MyTypeConverter))]
    public class ProductClass
    {
        public ProductClass()
        {
        }

        private int _ProductID = 0;
        [ORMKeyField()]
        public int ProductID
        {
            get { return _ProductID; }
            set { _ProductID = value; }
        }

        private string _ProductName = null;

        public string ProductName
        {
            get { return _ProductName; }
            set { _ProductName = value; }
        }


        private SupplierClass _Supplier = null;
        [ORMField("SupplierID")]
        [ORMRelation( ORMRelationStyle.OneToOne )]
        [ORMDelay()]
        public virtual SupplierClass Supplier
        {
            get { return _Supplier; }
            set { _Supplier = value; }
        }

        private int _CategoryID = 0;

        public int CategoryID
        {
            get { return _CategoryID; }
            set { _CategoryID = value; }
        }

        private string _QuantityPerUnit = null;

        public string QuantityPerUnit
        {
            get { return _QuantityPerUnit; }
            set { _QuantityPerUnit = value; }
        }

        private decimal _UnitPrice = 0;

        public decimal UnitPrice
        {
            get { return _UnitPrice; }
            set { _UnitPrice = value; }
        }

        private int _UnitsInStock = 0;

        public int UnitsInStock
        {
            get { return _UnitsInStock; }
            set { _UnitsInStock = value; }
        }

        private int _UnitsOnOrder = 0;

        public int UnitsOnOrder
        {
            get { return _UnitsOnOrder; }
            set { _UnitsOnOrder = value; }
        }


        private int _ReorderLevel = 0;

        public int ReorderLevel
        {
            get { return _ReorderLevel; }
            set { _ReorderLevel = value; }
        }

        private bool _Discontinued = false;

        public bool Discontinued
        {
            get { return _Discontinued; }
            set { _Discontinued = value; }
        }

        public override string ToString()
        {
            return "Product:" + this.ProductName;
        }
    }
}
